package org.code.mallspringboot.controller;

import org.code.mallspringboot.pojo.UmsMemberLevel;
import org.code.mallspringboot.service.UmsMemberLevelService;
import org.code.mallspringboot.vo.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UmsMemberLevelController {

    @Autowired
    private UmsMemberLevelService umsMemberLevelService;

    @GetMapping("/memberLevel/list")
    public CommonResult list(int defaultStatus){
        List<UmsMemberLevel> list = umsMemberLevelService.selectByStatus(defaultStatus);
        if (list.size() > 0){
            return CommonResult.success(list);
        }
        return CommonResult.failed("memberLevel获取失败");
    }
}
